#define _CRT_SECURE_NO_WARNINGS 1

#include"StackQueue.h"

void teststack()
{
	Stack plist;
	StackInit(&plist);
	StackPush(&plist, 1);
	StackPush(&plist, 2);
	StackPush(&plist, 3);
	printf("%d \n", StackTop(&plist));
	StackPop(&plist);
	StackPush(&plist, 4);
	StackPush(&plist, 5);
	int n = StackSize(&plist);
	printf("%d\n", n);
	while (!StackEmpty(&plist))
	{
		printf("%d ", StackTop(&plist));
		StackPop(&plist);
	}
	printf("\n");
}

void testqueue()
{
	Queue q;
	QueueInit(&q);
	QueuePush(&q, 1);
	QueuePush(&q, 2);
	QueuePush(&q, 3);
	printf("%d ", QueueFront(&q));
	QueuePop(&q);
	printf("%d\n", QueueBack(&q));
	int n = QueueSize(&q);
	printf("%d\n", n);
	QueuePush(&q, 4);
	QueuePush(&q, 5);
	while (!QueueEmpty(&q))
	{
		printf("%d ", QueueFront(&q));
		QueuePop(&q);
	}
}

int main()
{
	teststack();

	testqueue();

	return 0;
}